package com.mass.core.token;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.mass.core.utils.AjaxResponse;

@RequestMapping("/jwt")
@RestController
public class JwtController {

	@Autowired
	private JwtComponent jwtComponent;
	
	@RequestMapping("/getJwt")
	public AjaxResponse getJwt(String name, String userId, String role){
		String token = jwtComponent.createJWT(name, userId, role);
		return AjaxResponse.success(token);
	}
}
